home *** CD-ROM | disk | FTP | other *** search
- // ===========================================================================
- // Project : QuickDraw 3D
- // File : CustomAttribute.h
- //
- // Authors : Robin Landsbert
- //
- // ===========================================================================
-
- #include <QD3D.h>
- #include <QD3DSet.h>
-
- typedef long bool ;
-
- //------------------------------------------------------------------------------------------------
-
- void UnregisterCustomAttribute ( TQ3ObjectClass theClass ) ;
- TQ3ObjectClass RegisterCustomAttribute ( TQ3AttributeType theType , unsigned long theSize , TQ3MetaHandler theHandler ) ;
-
- //------------------------------------------------------------------------------------------------
-
- struct THandleRecord
- {
- unsigned long theSize ;
- Handle theHandle ;
- } ;
-
- //------------------------------------------------------------------------------------------------
- // Sound custom attribute
- //------------------------------------------------------------------------------------------------
- // the THandleRecord contains the entire sound
-
- const TQ3AttributeType kCustomSoundType = 'snd ' ;
- TQ3ObjectClass RegisterSoundAttribute ( void ) ;
-
- //------------------------------------------------------------------------------------------------
- // PICT custom attribute
- //------------------------------------------------------------------------------------------------
- // the THandleRecord contains the entire pict
-
- const TQ3AttributeType kCustomPictType = 'PICT' ;
- TQ3ObjectClass RegisterPictAttribute ( void ) ;
-
- //------------------------------------------------------------------------------------------------
- // TEXT custom attribute
- //------------------------------------------------------------------------------------------------
- // the THandleRecord contains the entire text
-
- const TQ3AttributeType kCustomTextType = 'TEXT' ;
- TQ3ObjectClass RegisterTextAttribute ( void ) ;
-
- //------------------------------------------------------------------------------------------------
- // Movie custom attribute
- //------------------------------------------------------------------------------------------------
- // the THandleRecord contains an alias record to the movie file
-
- const TQ3AttributeType kCustomMovieType = 'moov' ;
- TQ3ObjectClass RegisterMovieAttribute ( void ) ;
-
- //-----------------------------------------------------------------------------
- // Locked custom attribute
- //-----------------------------------------------------------------------------
- // the data is a long with the LSB being the global locked bit
-
- const TQ3AttributeType kLockedAttribute = 'LOCK' ;
-
- // Object Lock Stuff
- enum TObjectLockBits
- {
- kObjectLockedBit,
- kObjectConstrainPosXBit,
- kObjectConstrainPosYBit,
- kObjectConstrainPosZBit,
- kObjectConstrainSizeXBit,
- kObjectConstrainSizeYBit,
- kObjectConstrainSizeZBit,
- kObjectConstrainRotateXBit,
- kObjectConstrainRotateYBit,
- kObjectConstrainRotateZBit,
- kObjectProportionConstrainedBit,
- // only allows the object to be resized proportionally
- kObjectSimplifiableBit
- // user allows the object to be ungrouped or simplified if possible
- };
-
- enum TObjectLockMasks
- {
- kObjectAllUnlocked = 0L,
- kObjectLocked = 1L << kObjectLockedBit,
- kObjectConstrainPosX = 1L << kObjectConstrainPosXBit,
- kObjectConstrainPosY = 1L << kObjectConstrainPosYBit,
- kObjectConstrainPosZ = 1L << kObjectConstrainPosZBit,
- kObjectConstrainSizeX = 1L << kObjectConstrainSizeXBit,
- kObjectConstrainSizeY = 1L << kObjectConstrainSizeYBit,
- kObjectConstrainSizeZ = 1L << kObjectConstrainSizeZBit,
- kObjectConstrainRotateX = 1L << kObjectConstrainRotateXBit,
- kObjectConstrainRotateY = 1L << kObjectConstrainRotateYBit,
- kObjectConstrainRotateZ = 1L << kObjectConstrainRotateZBit,
- kObjectProportionConstrained= 1L << kObjectProportionConstrainedBit,
- kObjectSimplifiable = 1L << kObjectSimplifiableBit
- };
-
- typedef long TObjectLockFlags;
-
-
- const TQ3AttributeType kLockedAttribute = 'LOCK' ;
- TQ3ObjectClass RegisterLockedAttribute ( void ) ;
-
- //------------------------------------------------------------------------------------------------
- // Units custom attribute
- //------------------------------------------------------------------------------------------------
- // the data is a double which is the ratio between 1 model unit and 1 meter
- const TQ3AttributeType kUnitsAttribute = 'unts' ;
- const TQ3AttributeType kScaleAttribute = 'scle' ;
- TQ3ObjectClass RegisterUnitsAttribute ( void ) ;
- TQ3ObjectClass RegisterScaleAttribute ( void ) ;
-
- //------------------------------------------------------------------------------------------------
- // Description custom attribute
- //------------------------------------------------------------------------------------------------
- // the description is a THandleRecord containing the text
- const TQ3AttributeType kDescriptionAttribute = 'desc' ;
- TQ3ObjectClass RegisterDescriptionAttribute ( void ) ;
-
- //------------------------------------------------------------------------------------------------
- // Name custom attribute
- //------------------------------------------------------------------------------------------------
- // the name is a TQ3StringObject containing the text
- const TQ3AttributeType kNameAttribute = 'name' ;
- TQ3ObjectClass RegisterNameAttribute ( void ) ;
-
- //------------------------------------------------------------------------------------------------
- // Vector custom attribute
- //------------------------------------------------------------------------------------------------
- // these are TQ3Vector3Ds that define the direction
-
- const TQ3AttributeType kUpVectorAttribute = 'upvt' ;
- TQ3ObjectClass RegisterUpVectorAttribute ( void ) ;
-
- const TQ3AttributeType kForwardDirectionAttribute = 'fwrd' ;
- TQ3ObjectClass RegisterForwardDirectionAttribute ( void ) ;
-
- //------------------------------------------------------------------------------------------------
- // URL custom attribute
- //------------------------------------------------------------------------------------------------
-
- const TQ3AttributeType kW3AnchorAttribute = 'w3nr' ;
- const TQ3AttributeType kW3InlineAttribute = 'w3nl' ;
- const TQ3AttributeType kElementTypeWWWAnchor = 'wwwa' ; // obsolete
-
- typedef enum W3AnchorOptions
- {
- kW3AnchorOptionNone = 0 ,
- kW3AnchorOptionUseMap = 1
- } W3AnchorOptions ;
-
- typedef struct W3AnchorData
- {
- char *url ;
- TQ3StringObject description ;
- W3AnchorOptions options ;
- } W3AnchorData ;
-
- typedef struct W3InlineData
- {
- char *url ;
- } W3InlineData ;
-
-
- typedef struct WWWAnchorData
- {
- char *url ;
- } WWWAnchorData ;
-
- TQ3ObjectClass RegisterW3Anchor ( void ) ;
- TQ3ObjectClass RegisterW3Inline ( void ) ;
- TQ3ObjectClass RegisterWWWAnchor ( void ) ;
-